﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
using WPF项目.Common.Models;

namespace WPF项目.ViewModels
{
   public class HomeViweModel: BindableBase
    {
        public HomeViweModel() {
            TaskBars = new ObservableCollection<TaskBar>();
            CreateTaskBars();
            CreateTeseData();
        }

        private ObservableCollection<TaskBar> taskBars;

        public ObservableCollection<TaskBar> TaskBars
        {
            get { return taskBars; }
            set { taskBars = value; RaisePropertyChanged(); }
        }

        /// <summary>
        /// 代办
        /// </summary>
        private ObservableCollection<SoftwareData> softwaredata;

        public ObservableCollection<SoftwareData> SoftwareData
        {
            get { return softwaredata; }
            set { softwaredata = value; RaisePropertyChanged(); }
        }
        /// <summary>
        /// 备忘录
        /// </summary>
        private ObservableCollection<Memo> Memos;

        public ObservableCollection<Memo> MemoS
        {
            get { return Memos; }
            set { Memos = value; RaisePropertyChanged(); }
        }

        void CreateTaskBars()
        {
           
            TaskBars.Add(new TaskBar() { Icon = "ClockFast", Title = "汇总", Color = "#FF0CA0FF", Target = "ToDoView",  Content="9" });
            TaskBars.Add(new TaskBar() { Icon = "ClockCheckOutline", Title = "已完成", Color = "#FF1ECA3A", Target = "ToDoView", Content = "100%" });
            TaskBars.Add(new TaskBar() { Icon = "ChartLineVariant", Title = "完成比例", Color = "#FF02C6DC", Target = "", Content = "8" });
            TaskBars.Add(new TaskBar() { Icon = "PlaylistStar", Title = "备忘录", Color = "#FFFFA000", Target = "MemoView", Content = "6" });
        }
        void CreateTeseData()
        {
            SoftwareData=new ObservableCollection<SoftwareData>();
            
            MemoS=new ObservableCollection<Memo>();
            for (int i = 0; i < 10; i++)
            {
                SoftwareData.Add(new SoftwareData() { Title="代办"+i, Content="正在处理。。。" });
                MemoS.Add(new Memo() { Title = "备忘"+i, Content = "密码" });
            }
        }
    }
}
